r = 1 gotknife = 1 hunter = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH OR WEST" directions(3) = "SOUTH OR EAST" directions(4) = "NORTH OR EAST" directions(5) = "EAST, WEST, OR SOUTH" directions(6) = "NORTH, SOUTH, OR WEST" directions(7) = "SOUTH" directions(8) = "NORTH OR WEST" directions(9) = "NORTH OR EAST" PRINT "" PRINT "" PRINT "It was just another day, you were enjoying a wonderful morning out in the" PRINT "great outdoors. But outside of the confines of the woods a demonic force was" PRINT "growing in numbers. The force of the dead were claiming the world of the" PRINT "living. All while you were camping." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Dead Walk " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotknife = 1 THEN: PRINT "A stainless steel hunting knife." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 4 THEN: r = 3: GOTO moved IF r = 9 THEN: r = 5: GOTO moved IF r = 8 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 9 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 5 THEN: r = 9: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 8 THEN: r = 9: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 4: GOTO moved END IF IF (cmd$ = "USE KNIFE") THEN CLS PRINT "You take out the knife and hold it tightly. But you are not in any" PRINT "danger." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE RIVER") AND r = 8 THEN CLS PRINT "The once clear water that traveled down the carved path. It's red?" PRINT "You kneel down and it looks like...blood?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE HUNTER") AND r = 7 THEN CLS PRINT "The hunter looks dirty and crazy. His flesh is a shade of green and" PRINT "his eye's are a shade of yellow. He groans and mutters and slowly " PRINT "begin's walking towards you." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE KNIFE") AND gotknife = 1 THEN CLS PRINT "A knife you bought just for this trip. It's good for skinning" PRINT "any fish you caught." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE KNIFE") AND gotknife = 1 AND r = 7 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "RUN AWAY") AND r = 7 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing on a small hiking trail. The sun is rising and" PRINT "the warmth from it gives you a nice feeling." RETURN r2: PRINT "You wander down the path and notice that it's completely silent." RETURN r3: PRINT "Silence, just silence, no birds, or wildlife making a sound. But" PRINT "you continue down the beaten path in the direction of the car." RETURN r4: PRINT "The silent world around you is soon shattered as in the distance." PRINT "The sound of a branch snapping fills the air." RETURN r5: PRINT "You begin to feel afraid, afraid of what is out there." RETURN r6: PRINT "You are standing in a small clearing, you can see your car in the" PRINT "distance. -Thank God.- You say to yourself." RETURN r7: PRINT "You stop in shock as you bare witness to what appears to be a hunter." PRINT "He looks out of place, as if he's just survived a car wreck." RETURN r8: PRINT "Upon the journey you pass by a small stream. The once clear water" PRINT "is now a dark red." RETURN r9: PRINT "You arrive at the small parking lot. The world around you seems to" PRINT "have been changed in a way that you can't put your finger on it." PRINT "Just what is going on here?" RETURN win: COLOR 2, 0 CLS PRINT "You plunge the knife into the monsters neck and upon finding" PRINT "out that he kept moving towards you. You take the knife out" PRINT "and stab the crazy man in the head, killing him instantly. He" PRINT "falls to the ground and let's out a groan. You return to your" PRINT "car and findout that the world around you is forever changed." PRINT "You wonder just what the city is going to be like?" PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "As he tries to grab you, exposing his blood covered teeth. He" PRINT "just ate? You decide to make a dash away from this maniac and" PRINT "arrived at a ranger station a few miles away. It's empty but in" PRINT "the distance you see them limping towards you." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You return to your car and begin making the trek back into the city. You" PRINT "have work in the morning and you are looking forward to it. What a nice" PRINT "way to spend a Sunday. Hopefully next week is more eventful." _DISPLAY END END SUB